<?php

namespace App\Modules\Coupon\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class Coupon
 * @package App\Modules\Coupon\Models
 * @property int $shop_id
 * @property string $typed
 * @property string $name
 * @property int $price_limit
 * @property int $money
 * @property int $shelf_life
 * @property array $applicable
 * @property integer $is_gift
 * @property int $link_id
 */
class Coupon extends Model
{
    use SoftDeletes;

    const TYPE_PACKAGE = 'package';
    const TYPE_GOOD = 'good';

    public static $typeShow = [
        self::TYPE_PACKAGE => "套系优惠券",
        self::TYPE_GOOD => "商品优惠券",
    ];

    protected $fillable = [
        'shop_id',
        'type',
        'title',
        'price_limit',
        'money',
        'shelf_life',
        'applicable',
        'is_gift',
        'link_id',
        'share_image',
    ];

    protected $casts = [
        'applicable' => 'array',
    ];
}
